VAS.RowEditorGrid = Ext.extend(Ext.ux.DynamicGridPanel, {
	
	initComponent : function() {
		var _this=this;
    _this.editor = new Ext.ux.grid.RowEditor({
        saveText: '修改',
        cancelText:'取消',
        clicksToEdit:1
        ,errorSummary: false 
    });

		var config = {
		
			plugins :_this.editor
		};
//		_this.editor.on({afteredit:function(){alert(1)}});
		
		
		Ext.apply(this, config);
		Ext.apply(this.initialConfig, config);
		VAS.RowEditorGrid.superclass.initComponent.apply(this, arguments);
	},
	onRender : function(ct, position) {		
		var _this=this;
//		this.colModel.defaultSortable = true;
		VAS.RowEditorGrid.superclass.onRender.call(this, ct, position);
		this.store.on({'update':function(){
			Ext.Msg.show({
				title : '提示',
				msg : '确实要修改吗?',
				buttons : {yes:'是', no:'否'},
				fn : function(btn){
			    	if (btn == 'yes'){
			       		Ext.Ajax.request({
							url : $action,
							success : function(response, options) {
								//检查session是否过期
				   				checkTimeOut(response);
								var responseObj = Ext.util.JSON.decode(response.responseText);
								if(responseObj.success){
									if(responseObj.msg == '' ||  responseObj.msg == undefined){
										responseObj.msg = '成功'
									}
									Ext.MessageBox.alert('提示', responseObj.msg);
								}else{
									alertFailure(responseObj);
								}
							},
							failure : function(response, options) {
								Ext.Msg.alert('提示','服务器异常！');
							},
							params:{tbarId:$tbarId,data:Ext.util.JSON.encode(_postData)}
						})
			    	}else{
			    		return;	
			    	}
				}
			})
		}}, this);
	}
})
